<template>
	<view @click="clickFillRecordItem(data)" class="fill-record-item">
		<view class="box-con">
			<view class="box-item title">{{ data.mpName || '' }}</view>
			<view class="box-item">
					<u-icon name="clock" color="#6a819e" size="14"></u-icon>
					<view style="margin-left: 10rpx;">{{ data.formType == 1 ? '出场日期' : (data.formType == 2 ? '进场日期' : (data.formType == 3 ? '进场日期' : '')) }}：{{ getDate(data.approachTime) }}</view>
					
			</view>
			<view class="box-item" style="justify-content: space-between;">
				<view class="">
					<text style="font-size: 28rpx;font-weight: 500;margin-right: 20rpx;">
						{{ data.formType == 1 ? '出场:' : (data.formType == 2 ? '进场:' : (data.formType == 3 ? '进场:' : '')) }}
					</text>
					<text style="font-weight: bold;font-size: 34rpx;">{{ data.number }}{{ data.unit }}</text>
				</view>
				<view style="padding-right: 200rpx;">
					<text style="font-size: 28rpx;font-weight: 500;margin-right: 20rpx;">
						{{ data.formType == 1 ? '累计数量:' : (data.formType == 2 ? '累计数量:' : (data.formType == 3 ? '累计数量:' : '')) }}
					</text>
					<text style="font-weight: bold;font-size: 34rpx;">{{ data.sumNumber }}{{ data.unit }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import mixins from "@/utils/mixins.js"
	
	export default {
		name: "fill-record-item",
		mixins: [mixins],
		props: {
			data: {
				type: Object,
				default: () => ({}),
			},
		},
		data() {
			return {
				isLoading: false,
			}
		},
		methods: {
			/** 点击某一项 */
			clickFillRecordItem(item) {
				item.pageType = 'look'
				uni.navigateTo({
					url: `/subpackage-mjs/pages/dailyTaskList/report-detail`,
					success: (res) => {
						res.eventChannel.emit('getDetailsInfo', {
							data:item
						})
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.fill-record-item {
		background: #fff;
		// border-radius: 20upx;
		margin: 20upx 26upx;
		border-bottom: 2rpx solid #E0E7F6;
		// margin-top: 30rpx;

		.title {
			color: #22204e;
			font-weight: bold;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.title-text {
				line-height: 40upx;
				max-width: 700upx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}

		.box-con {
			margin-top: 16upx;
			// line-height: 28upx;
			font-size: 28upx;
			color: #6a819e;
			padding-bottom: 16rpx;

			.box-item {
				display: flex;
				align-items: center;
				font-weight: bold;
				margin: 20upx 4upx;
				// line-height: 28upx;
				max-width: 700upx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				&.title {
					font-weight: 600;
					font-size: 36rpx;
					color: #2F80ED;
				}
			}
		}
		.btn-op {
			display: flex;
			align-items: center;
			justify-content: flex-end;
			margin-top: 10upx;
			.op-red, .op-blue{
				width: 128upx;
				height: 60upx;
				background: #FF6A6A;
				border-radius: 8upx;
				text-align: center;
				color: white;
				font-size: 28upx;
				font-weight: 500;
				line-height: 60upx;
			}
			.op-blue {
				background: #2F80ED;
				margin-left: 20upx;
			}
		}


	}
</style>